<template>
	<van-nav-bar :title="title" :left-arrow='showLeftArrow' @click-left="onClickLeft" fixed></van-nav-bar>
</template>

<script>
	import {
		NavBar
	} from "vant";

	export default {
		name: "NavBarCustom",
		components: {
			[NavBar.name]: NavBar
		},
		props: {
			// 标题
			title: {
				type: String,
				default: ""
			},
			// 是否展示左侧箭头
			showLeftArrow: {
				type: Boolean,
				default: false
			},
		},
		data() {
			return {};
		},
		methods: {
			// 返回上一页
			onClickLeft() {
				this.$router.back();
			}
		}
	};
</script>

<style scoped lang="less">
	.van-nav-bar {
		::v-deep .van-icon{
			font-size: 35px;
			color: #000000;
		}
	}
</style>
